package ModelLayer;
import java.util.*;


public class Person
{
    private long id;
    private String name;
    private String address;
    private String postalCode;
    private String city;
    private String phone;
    private ArrayList<Loan> loans;

    /**
     * Constructor for objects of class Person
     */
    public Person(long id,String name,String address,String postalCode,String city,String phone){
        
        this.id=id;
        this.name=name;
        this.address=address; 
        this.postalCode=postalCode;
        this.city=city;
        this.phone=phone;
        loans = new ArrayList<Loan>();
    }
    
    
    /**
     * Set and get methods.
     */
    
    public void setId(int newId){
        
        this.id=newId;
    }
    
    public long getId(){
        
        return this.id;
    }
    
    
    
    public void setName(String newName){
        
        this.name=newName;
    }
    
    public String getName(){
        
        return this.name;
    }
    
    
    
    public void setAddress(String newAddress){
        
        this.address=newAddress;
    }
    
    public String getAddress(){
        
        return this.address;
    }
    
    
    
    public void setPostalCode(String newPostalCode){
        
        this.postalCode=newPostalCode;
    }
    
    public String getPostalCode(){
        
        return this.postalCode;
    }
    
    
    
    public void setCity(String newCity){
        
        this.city=newCity;
    }
    
    public String getCity(){
        
        return this.city;
    }
    
    
    
    public void setPhone(String newPhone){
        
        this.phone=newPhone;
    }
    
    public String getPhone(){
        
        return this.phone;
    } 
    
    /**
     * Print information
     *     
     */
    
    public void print(){
        
        System.out.println("ID:"+this.id+" ");
        System.out.println("Name:"+this.name+" ");
        System.out.println("Address:"+this.address+" ");
        System.out.println("Postal code:"+this.postalCode+" ");
        System.out.println("City:"+this.city+" ");
        System.out.println("Phone:"+this.phone+" ");
    }
    
    /**
     * Add loan
     */
    public void addLoan(Loan loan)
    {
        loans.add(loan);
    }
    
    public void removeLoan(Loan loan)
    {
        loans.remove(loan);
    }
    
    public ArrayList getLoans()
    {
        return loans;
    }
    
    
}
